package myJs.myPkg.reactBootstrap

import japgolly.scalajs.react.CtorType.ChildArg
import japgolly.scalajs.react.{Children, JsComponent}
import slinky.readwrite._

import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport

/** Created by yz on 28/3/2022
  */

object ModalDialog {
  case class Props(
      centered: js.UndefOr[Boolean] = js.undefined,
      contentClassName: js.UndefOr[String] = js.undefined,
      scrollable: js.UndefOr[Boolean] = js.undefined,
      size: js.UndefOr[String] = js.undefined,
      bsPrefix: js.UndefOr[String] = js.undefined,
      fullscreen: js.UndefOr[Boolean] = js.undefined
  )

  @js.native
  @JSImport("react-bootstrap", "ModalDialog")
  object RawComponent extends js.Object {}

  val Component = JsComponent[ObjectOrWritten[Props], Children.Varargs, Null](RawComponent)

  def apply(
      centered: js.UndefOr[Boolean] = js.undefined,
      contentClassName: js.UndefOr[String] = js.undefined,
      scrollable: js.UndefOr[Boolean] = js.undefined,
      size: js.UndefOr[String] = js.undefined,
      bsPrefix: js.UndefOr[String] = js.undefined,
      fullscreen: js.UndefOr[Boolean] = js.undefined
  )(children: ChildArg*) = {
    Component(Props(centered, contentClassName, scrollable, size, bsPrefix, fullscreen))(children: _*)
  }

}
